// eslint-disable-next-line
import { UserLayout, BasicLayout, RouteView, BlankLayout, PageView } from '@/layouts'
import { bxAnaalyse } from '@/core/icons'

export const asyncRouterMap = [

  {
    path: '/',
    name: 'MenuIndex.vue',
    component: BasicLayout,
    meta: { title: '首页' },
    redirect: '/dashboard/workplace',
    children: [
      // dashboard
      {
        path: 'dashboard',
        name: 'dashboard',
        redirect: '/dashboard/workplace',
        component: RouteView,
        // eslint-disable-next-line standard/object-curly-even-spacing
        meta: { title: '仪表盘', keepAlive: true, icon: bxAnaalyse /* permission: [ 'dashboard' ] */ },
        children: [
          {
            path: 'analysis/:pageNo([1-9]\\d*)?',
            name: 'Analysis',
            component: () => import('@/views/system/dashboard/Analysis'),
            // eslint-disable-next-line standard/object-curly-even-spacing
            meta: { title: '分析页', keepAlive: true /* permission: [ 'dashboard' ] */ }
          },
          {
            path: 'workplace',
            name: 'Workplace',
            component: () => import('@/views/system/dashboard/Workplace'),
            // eslint-disable-next-line standard/object-curly-even-spacing
            meta: { title: '工作台', keepAlive: false/*, permission: [ 'dashboard' ] */ }
          }
        ]
      }
    ]
  },
  {
    path: '*', redirect: '/404', hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/userLoginReg/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import(/* webpackChunkName: "user" */ '@/views/userLoginReg/Register')
      },
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import(/* webpackChunkName: "user" */ '@/views/userLoginReg/RegisterResult')
      },
      {
        path: 'recover',
        name: 'recover',
        component: undefined
      }
    ]
  },
  {
    path: '/saleOrderForm',
    component: BasicLayout,
    redirect: '/saleOrder',
    meta: { title: '销售订单' },
    hidden: true,
    children: [
      {
        path: 'add',
        name: 'addSaleOrder',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/order/sale/addForm'),
        meta: { title: '新增销售订单', keepAlive: true, icon: bxAnaalyse }
      },
      {
        path: 'edit',
        name: 'editSaleOrder',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/order/sale/editForm'),
        meta: { title: '编辑销售订单', keepAlive: false, icon: bxAnaalyse }
      },
      {
        path: 'view',
        name: 'viewSaleOrder',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/order/sale/view'),
        meta: { title: '销售订单详情', keepAlive: false, icon: bxAnaalyse }
      },
      {
        path: 'outbound',
        name: 'outboundSaleOrder',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/order/sale/outbound'),
        meta: { title: '销售订单出库', keepAlive: false, icon: bxAnaalyse }
      }
    ]
  },
  {
    path: '/purchaseOrderForm',
    component: BasicLayout,
    redirect: '/purchaseOrder',
    meta: { title: '采购订单' },
    hidden: true,
    children: [
      {
        path: 'add',
        name: 'addPurchaseOrder',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/order/purchase/addForm'),
        meta: { title: '新增采购订单', keepAlive: true, icon: bxAnaalyse }
      },
      {
        path: 'edit',
        name: 'editPurchaseOrder',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/order/purchase/editForm'),
        meta: { title: '编辑采购订单', keepAlive: false, icon: bxAnaalyse }
      },
      {
        path: 'view',
        name: 'viewPurchaseOrder',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/order/purchase/view'),
        meta: { title: '采购订单详情', keepAlive: false, icon: bxAnaalyse }
      },
      {
        path: 'storage',
        name: 'storagePurchaseOrder',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/order/purchase/storage'),
        meta: { title: '采购到货入库', keepAlive: false, icon: bxAnaalyse }
      }
    ]
  },
  {
    path: '/storagePurchaseForm',
    component: BasicLayout,
    redirect: '/storagePurchase',
    meta: { title: '采购到货' },
    hidden: true,
    children: [
      {
        path: 'view',
        name: 'viewStoragePurchase',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/storage/purchase/view'),
        meta: { title: '采购到货详情', keepAlive: false, icon: bxAnaalyse }
      }
    ]
  },
  {
    path: '/outboundSaleForm',
    component: BasicLayout,
    redirect: '/outboundSale',
    meta: { title: '销售出库' },
    hidden: true,
    children: [
      {
        path: 'view',
        name: 'viewOutboundSale',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/outbound/sale/view'),
        meta: { title: '销售出库详情', keepAlive: false, icon: bxAnaalyse }
      }
    ]
  },
  {
    path: '/outboundOtherForm',
    component: BasicLayout,
    redirect: '/outboundOther',
    meta: { title: '其他出库' },
    hidden: true,
    children: [
      {
        path: 'add',
        name: 'addOutboundOther',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/outbound/other/addForm'),
        meta: { title: '新增其他出库', keepAlive: true, icon: bxAnaalyse }
      },
      {
        path: 'view',
        name: 'viewOutboundOther',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/outbound/other/view'),
        meta: { title: '其他出库详情', keepAlive: false, icon: bxAnaalyse }
      }
    ]
  },
  {
    path: '/storageOtherForm',
    component: BasicLayout,
    redirect: '/storageOther',
    meta: { title: '其他入库' },
    hidden: true,
    children: [
      {
        path: 'add',
        name: 'addStorageOther',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/storage/other/addForm'),
        meta: { title: '新增其他入库', keepAlive: true, icon: bxAnaalyse }
      },
      {
        path: 'view',
        name: 'viewStorageOther',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/storage/other/view'),
        meta: { title: '其他入库详情', keepAlive: false, icon: bxAnaalyse }
      }
    ]
  },
  {
    path: '/inventoryForm',
    component: BasicLayout,
    redirect: '/inventory',
    meta: { title: '盘库' },
    hidden: true,
    children: [
      {
        path: 'add',
        name: 'addInventory',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/stock/inventory/addForm'),
        meta: { title: '新增盘库单', keepAlive: true, icon: bxAnaalyse }
      },
      {
        path: 'edit',
        name: 'editInventory',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/stock/inventory/editForm'),
        meta: { title: '编辑盘库单', keepAlive: false, icon: bxAnaalyse }
      },
      {
        path: 'view',
        name: 'viewInventory',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/stock/inventory/view'),
        meta: { title: '盘库单详情', keepAlive: false, icon: bxAnaalyse }
      }
    ]
  },
  {
    path: '/materialBomForm',
    component: BasicLayout,
    redirect: '/materialBom',
    meta: { title: '物料BOM' },
    hidden: true,
    children: [
      {
        path: 'add',
        name: 'addMaterialBom',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/base/material/bom/addForm'),
        meta: { title: '新增物料BOM', keepAlive: true, icon: bxAnaalyse }
      },
      {
        path: 'edit',
        name: 'editMaterialBom',
        component: () => import(/* webpackChunkName: "user" */ '@/views/main/base/material/bom/editForm'),
        meta: { title: '编辑物料BOM', keepAlive: false, icon: bxAnaalyse }
      }
    ]
  },
  {
    path: '/test',
    component: BlankLayout,
    redirect: '/test/home',
    children: [
      {
        path: 'home',
        name: 'TestHome',
        component: () => import('@/views/Home')
      }
    ]
  },

  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/system/exception/404')
  }

]
